HADOOP_VERSION=3.1.1
HADOOP_IMAGE_VERSION=0.1

clean_images:
	docker images |grep none|awk '{print $3}'|xargs docker rmi $i

.PONY: build_base
build_base:
	docker build -t registry.cn-hangzhou.aliyuncs.com/wenjie-dev/big-data-base:${HADOOP_IMAGE_VERSION} .

.PONY: build_hadoop
build_hadoop:
	docker build -f hadoop/Dockerfile \
		--build-arg HADOOP_VERSION=${HADOOP_VERSION} \
		-t registry.cn-hangzhou.aliyuncs.com/wenjie-dev/big-data-hadoop:${HADOOP_IMAGE_VERSION} .

.PONY: test_hadoop
test_hadoop:
	docker run -it --rm --user=root \
		-v ${PWD}/hadoop/conf:/opt/apache/hadoop/etc/hadoop \
		--entrypoint /bin/bash \
		registry.cn-hangzhou.aliyuncs.com/wenjie-dev/big-data-hadoop:${HADOOP_IMAGE_VERSION}